package com.lzk.jetpacktest.workmanager

import android.content.Context.MODE_PRIVATE
import android.content.SharedPreferences
import com.lzk.jetpacktest.MainApp
import java.util.*

/**
 * @Author: LiaoZhongKai
 * @Date: 2021/8/31 14:37
 * @Description:
 */
object WorkerStore {
    private const val SP_NAME = "worker_sp"
    private const val KEY_UUID = "key_uuid"

    private val mSp = MainApp.getInstance().getContext().getSharedPreferences(
        SP_NAME,MODE_PRIVATE)
    private val mEditor: SharedPreferences.Editor = mSp.edit()

    fun saveWorkerUUID(uuid: String){
        mEditor.putString(KEY_UUID,uuid).apply()
    }

    fun getWorkerUUID(): String?{
        return mSp.getString(KEY_UUID,null)
    }

}